<#macro head title>
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>${title}</title>
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
    <link rel="stylesheet" href="${ctx}/adminlte/bootstrap/css/bootstrap.min.css">
    <link href="${ctx}/adminlte/bootstrap/css/font-awesome.min.css" rel="stylesheet">
    <link href="${ctx}/adminlte/bootstrap/css/ionicons.min.css" rel="stylesheet">
    <link rel="stylesheet" href="${ctx}/adminlte/plugins/select2/select2.min.css">
    <link rel="stylesheet" href="${ctx}/adminlte/dist/css/AdminLTE.min.css">
    <!-- AdminLTE Skins. Choose a skin from the css/skins
         folder instead of downloading all of them to reduce the load. -->
    <link rel="stylesheet" href="${ctx}/adminlte/dist/css/skins/_all-skins.min.css">

    <!-- iCheck -->
    <link rel="stylesheet" href="${ctx}/adminlte/plugins/iCheck/flat/blue.css">

    <!-- Morris chart -->
    <link rel="stylesheet" href="${ctx}/adminlte/plugins/morris/morris.css">
    <!-- jvectormap -->
    <link rel="stylesheet" href="${ctx}/adminlte/plugins/jvectormap/jquery-jvectormap-1.2.2.css">
    <!-- Date Picker -->
    <link rel="stylesheet" href="${ctx}/adminlte/plugins/datepicker/datepicker3.css">
    <!-- Daterange picker -->
    <link rel="stylesheet" href="${ctx}/adminlte/plugins/daterangepicker/daterangepicker-bs3.css">
    <!-- bootstrap wysihtml5 - text editor -->
    <link rel="stylesheet" href="${ctx}/adminlte/plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.min.css">

    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
        <script src="${ctx}/adminlte/plugins/html5shiv/html5.min.js"></script>
        <script src="${ctx}/adminlte/plugins/respond/respond.min.js"></script>
    <![endif]-->
    <#nested>
</head>
</#macro>
<#macro layout menu>
<body class="hold-transition skin-blue sidebar-mini">
    <div class="wrapper">
        <header class="main-header">
        <!-- Logo -->
        <a href="${ctx}/" class="logo">
          <!-- mini logo for sidebar mini 50x50 pixels -->
          <span class="logo-mini"><b>汇</b>智</span>
          <!-- logo for regular state and mobile devices -->
          <span class="logo-lg"><b>汇智</b>智能</span>
        </a>
        <!-- Header Navbar: style can be found in header.less -->
        <nav class="navbar navbar-static-top" role="navigation">
          <!-- Sidebar toggle button-->
          <a href="${ctx}/" class="sidebar-toggle" data-toggle="offcanvas" role="button">
            <span class="sr-only">Toggle navigation</span>
          </a>
          <div class="navbar-custom-menu">
            <ul class="nav navbar-nav">
              <!-- User Account: style can be found in dropdown.less -->
           <@shiro.authenticated>
           <li><a href="#" calss="dropdown-toggle" data-toggle="dropdown" aria-expanded="true">欢迎您:<@shiro.loginUsername name="username"/></a>
           	<ul class="dropdown-menu">
           		<li>
           			<a href="javascript:updatepassword('${ctx}/admin/updatePwd')">修改密码</a>
           		</li>
           	</ul>
           </li>
             <li><a href="${ctx}/admin/signout">注销</a></li>
           </@shiro.authenticated>
			<!-- Control Sidebar Toggle Button -->
              <li>
                <a href="http://www.zj.10086.cn/group/" target="_blank"><i class="fa fa-gears"></i></a>
              </li>
            </ul>
          </div>
        </nav>
      </header>
      <!-- Left side column. contains the logo and sidebar -->
   <aside class="main-sidebar">
    <section class="sidebar">
        <ul class="sidebar-menu">
            <li class="header">MAIN NAVIGATION</li>
            <!-- 系统管理 -->
            <#list treeviews?sort_by("order") as parent>
                <li class="treeview  <#if parent.childMenu?seq_contains(menu)>active</#if>">
                    <a href="#">
                        <i class="fa fa-laptop"></i> <span>${parent.name}</span> <i class="fa fa-angle-left pull-right"></i>
                    </a>
                    <ul class="treeview-menu">
                        <#list parent.child?sort_by("order") as child>
                            <li class="<#if menu=='/${child.action}'>active</#if>"><a href="${ctx}/${child.action}"><i class="fa fa-circle-o"></i>${child.name}</a>
                            </li>
                        </#list>
                    </ul>
            </#list>
        </ul>
    </section>
</aside>
    <!-- jQuery 2.1.4 -->
    <script src="${ctx}/adminlte/plugins/jQuery/jQuery-2.1.4.min.js"></script>
    <!-- Bootstrap 3.3.5 -->
    <script src="${ctx}/adminlte/bootstrap/js/bootstrap.min.js"></script>
      <div class="content-wrapper" >
      <#nested>
      <div class="clearfix"></div>
      </div>
      <footer class="main-footer no-print">
        <div class="pull-right hidden-xs">
          <b>Version</b> 1.1.0
        </div>
        <strong>Copyright &copy; 2017 <a href="#">汇智智能</a>.</strong> All rights reserved.
      </footer>
    </div>

    <!-- SlimScroll -->
    <script src="${ctx}/adminlte/plugins/slimScroll/jquery.slimscroll.min.js"></script>
    <!-- FastClick -->
    <script src="${ctx}/adminlte/plugins/fastclick/fastclick.min.js"></script>
    <!-- AdminLTE App -->
    <script src="${ctx}/adminlte/dist/js/app.min.js"></script>
    <script type="text/javascript" src="${ctx}/adminlte/plugins/bootbox/bootbox.min.js"></script>
    </#macro>

    <#macro scripts>
    <script type="text/javascript">
	bootbox.setLocale("zh_CN");
	function updatepassword(url){
		bootbox.prompt({title: "请输入新密码", inputType: 'password', callback: function(result){
			if(result!=null&&result!=""){
				$.ajax({
					"type" : "post",
					"url" : url,
					"data" : {
						password : result
					},
					"dataType" : "json",
					"async" : false,
					"success" : function(data) {
						bootbox.alert(data.message);
					}
				});
				
			}else if(result!=null){
				bootbox.alert("密码不能为空！");
			}
		}});		
	};
</script>

<#nested>
</body>
</html>
</#macro>